<script src="__CDN__/assets/libs/jquery/dist/jquery.min.js"></script>
<script src="__CDN__/assets/question/js/vue.js"></script>
<link rel="stylesheet" type="text/css" href="__CDN__/assets/question/css/common.css"></link>
<script src="__CDN__/assets/question/js/element-ui/index.js"></script>
<link rel="stylesheet" type="text/css" href="__CDN__/assets/question/js/element-ui/index.css"></link>


<div id="app">
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('考试分类')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-exam_cate_id" data-rule="required" data-source="examcate/index" class="form-control selectpage" name="row[exam_cate_id]" type="text" value="{$row.exam_cate_id|htmlentities}">
        </div>
    </div>


    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text" value="{$row.title|htmlentities}">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Mode')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="radio">
                {foreach name="modeList" item="vo"}
                <label for="row[mode]-{$key|htmlentities}">
                    <input @change="changeMode" id="row[mode]-{$key|htmlentities}" name="row[mode]" type="radio" value="{$key|htmlentities}" {in name="key" value="$row.mode" }checked{/in} /> {$vo|htmlentities}
                </label>
                {/foreach}
            </div>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Configs')}:</label>
        <div class="col-xs-12 col-sm-8" v-show="mode === 'FIX'">
            <a href="javascript:;" class="btn btn-sm btn-success btn-fix-configs margin-bottom" @click="openQuestionSelect()"><i class="fa fa-cog"></i> 固定选题配置</a>
            {include file="../application/admin/view/exampaper/configs_setting_fix.html" /}
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Quantity')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-quantity" data-rule="required" class="form-control" name="row[quantity]" type="number"
                   value="{$row.quantity|htmlentities}" step="1" min="1" placeholder="请输入试卷总题数">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Total_score')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-total_score" data-rule="required" class="form-control" name="row[total_score]" type="number"
                   value="{$row.total_score|htmlentities}" step="1" min="1" placeholder="请输入试卷总分数">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Pass_score')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-pass_score" data-rule="required" class="form-control" name="row[pass_score]" type="number"
                   value="{$row.pass_score|htmlentities}" step="1" min="1" placeholder="请输入及格分数">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Limit_time')}:</label>
        <div class="col-xs-12 col-sm-8" style="line-height: 31px;">
            <input id="c-limit_time" data-rule="required" class="form-control hide" name="row[limit_time]"
                   value="{$row.limit_time|default=0}" type="number" step="1" min="0" placeholder="考试限时，0不限制"
                   style="width: 200px">

            <input id="c-limit_time_hour" data-rule="required" class="form-control" name="row[limit_time_hour]"
                   type="number" step="1" min="0" max="23" value="0" style="width: 100px" placeholder="考试限时小时">时
            <input id="c-limit_time_minute" data-rule="required" class="form-control" name="row[limit_time_minute]"
                   type="number" step="1" min="0" max="60" value="60" style="width: 100px" placeholder="考试限时分钟，0不限制">分
        </div>
    </div>
    
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Start_time')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-start_time" data-rule="match(lte, row[end_time], date);" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[start_time]" type="text" value="{:$row.start_time?datetime($row.start_time):''}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('End_time')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-end_time" data-rule="match(gte, row[start_time], date);" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[end_time]" type="text" value="{:$row.end_time?datetime($row.end_time):''}">
            <p class="text-info">* 试卷使用（开始、结束）时间，清空则不限制试卷使用时间</p>
        </div>
    </div>
    

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Describe')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div id="c-describe">
                <textarea id="c-describe" class="form-control editor" name="row[describe]">{$row.describe}</textarea>
            </div>
        </div>
    </div>
    
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">
            
            <div class="radio">
            {foreach name="statusList" item="vo"}
            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label> 
            {/foreach}
            </div>

        </div>
    </div>


    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
        </div>
    </div>
</form>
</div>
<!--试卷设置扩展-->
{include file="../application/admin/view/exampaper/extend.html" /}
